package com.transsion.clouddemo.core.know

import android.os.Bundle
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import android.widget.TextView
import androidx.fragment.app.Fragment
import com.transsion.clouddemo.R
import com.transsion.clouddemo.core.Custom.CloudClickListener
import com.transsion.clouddemo.core.Custom.CopyLinkTextHelper
import com.transsion.clouddemo.core.DataGenerator

class SyncFragment: Fragment()  {


    companion object {
        fun newInstance(): SyncFragment {
            return SyncFragment()
        }
    }


    override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?,
                              savedInstanceState: Bundle?): View? {
        val inflateView = inflater.inflate(R.layout.cloud_sync, container, false)
        val copyButton = inflateView.findViewById<TextView>(R.id.sync_document_address)
        copyButton.setOnClickListener(object : CloudClickListener(){
            override fun onSingleClick(view: View) {
                context?.let { CopyLinkTextHelper.getInstance(it)?.copyUrl(DataGenerator.CLOUD_SDK_DOC) }
//                context?.let { ToastUtils.showCustomTime(it,"拷贝成功",1000) }
            }
        })
        return inflateView
    }



}